package com.foogui.faw.oa.listener;


import com.foogui.common.model.Result;
import com.foogui.faw.oa.listener.service.ProcessApiService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "/processApi")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Slf4j
public class ProcessApiController {

    private final ProcessApiService processApiService;


    /**
     * 监听工作流回调(需要发布在开放网关上)
     */
    @RequestMapping(value = "/listenerBPMCallBack", method = RequestMethod.POST)
    public Result<String> listenerBPMCallBack(@RequestBody Object request) {
        return Result.success(processApiService.listenerBPMCallBack(request));
    }


}
